<template>
    <div class="index-page">
        <main>我是index</main>
        <SelectTimeQuantum v-if="setTime" :timmer="timmer" @getTimmer="getTimmer" @clear="clearClick" />
        <div>{{ selectTime }}</div>
    </div>
</template>

<script setup>
import { ref } from "vue";
import { useRoute } from "vue-router";
import SelectTimeQuantum from "@/components/SelectTimeQuantum.vue";

const { query } = useRoute();

console.log(query.id);

console.log("master-01");
console.log("master-wxy-01");

console.log("master-02");
console.log("master-03");

// 设置投放时间
const setTime = ref(true);

const selectTime = ref([]);

const timmer = ref([{ arr: [] }, { arr: [] }, { arr: [] }, { arr: [] }, { arr: [] }, { arr: [] }, { arr: [] }]);

function getTimmer(data) {
    let list = JSON.parse(JSON.stringify(data));
    let time = list.map(item => item.arr);
    console.log("选中的时间", time);
    selectTime.value = time;
}

function clearClick(val) {
    selectTime.value = val;
}
</script>

<style lang="less" scoped>
.index-page {
}
</style>
